package com.gzdh.dishrecognition.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Window;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.gzdh.dishrecognition.R;

public class PayingDialog extends Dialog {
    private Context mContext;
    private Window window = null;

    TextView msgTv;


    public PayingDialog(@NonNull Context context) {
        super(context, R.style.CustomDialog);
    }

    private void initView() {
        msgTv = findViewById(R.id.msgTv);
    }

    private void initData() {

    }


    public void setMsg(String msg) {
        msgTv.setText(msg);
    }

    private void initEvent() {

    }

    private void windowDeploy() {
        window = getWindow();
        window.setGravity(Gravity.CENTER); //设置窗口显示位置
//        window.setWindowAnimations(R.style.dialogWindowAnim); //设置窗口弹出动画
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this.getContext();
//        View view = getView();
        setContentView(R.layout.dialog_paying);
//        setContentView(view);

        //点击dialog以外的空白处是否隐藏
        setCanceledOnTouchOutside(false);
        //初始化界面控件
        initView();
        //初始化界面数据
        initData();
        //初始化界面控件的事件
        initEvent();
        //设置窗口显示
        windowDeploy();
    }


}
